<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var obj = {
            "username":"张三",
            "age":20,
            "gender":"男"
        }
        var jsonObj = JSON.stringify(obj);


        console.log(jsonObj);

        var obj1 = JSON.parse(jsonObj);
        console.log(obj1);
        
        
        var objs = new Object();
        objs.username="李华";
        objs.hobby=["唱","跳","rap","篮球"];
        objs.age=2.5;
        objs.gender="男";
        console.log(objs);
        
    </script>
</body>
</html>